/*home.js*/


// function close(id){
// 	var element = document.getElementById(id);
// 	console.log(element.style.display);
// 	if(element.style.display === 'block'){
// 		element.style.display = 'none';
// 	}
// };

/*
function sendModify(){

}*/


// console.log(location.search);

/*function func(param){
	// console.log(${param.name});
	var toUrl = '/about/about.html?name=' + param;
	if(param){
		window.open(toUrl);
		$('#' + param).trigger('click');
	}
}*/

$(function(){

	//可移动二维码
	$('#draggable').draggable();

	//点击微信过渡显示或隐藏二维码图像
	$('#icon-chat').click(function(){
		$('#pic-chat').toggle(1000);
	});

	//控制状态框的点击事件
	$('#show-login').click(function(){
		$('#login-box').css('display','block');
		$('#register-box').css('display','none');
	});

	$('.login-box .close-box').click(function(){
		$('#login-box').css('display','none');
	});

	$('#show-register').click(function(event){
		event.stopPropagation();
		if($('#register-box').css('display','none')) {
			$('#register-box').css('display', 'block');
		}
		if($('.reset-box').css('display') === 'block'){
			$('.reset-box').css('display','none');
			$('#register-box').css('display', 'block');
		}
		$('#login-box').css('display','none');
	});

	$('#register-box .close-box').click(function(){
		$('#register-box').css('display','none');
	});

	$('#for-psd').click(function(){
		$('#reset').css('display','block');
		$('#login-box').css('display','none');
	});

	$('.reset-box .close-box').click(function(){
		$('#reset').css('display','none');
	});

	$('.old-user').click(function(){
		$('#login-box').css('display','block');
		$('#register-box').css('display','none');
	});

//	状态切换
	$('.send').click(function(){
		$('.send').css('display','none');
		$('.times').css('display','inline-block');
	});

	//按钮禁用和可用的控制事件
	$('#account').blur(function(){
		var account = $('#account').val();
		console.log(account);
		if(account !== undefined){

			$('#account-psd').blur(function(){
				var psd = $('#account-psd').val();
				console.log(psd);
				if(psd !== undefined)
					$('.foreground .footer').css('cursor','pointer').css('background-color','#326292')
			});
		}
	});

	//对选中列表项添加样式
	$('#list li').click(function (){
		if(!$(this).hasClass('selected')){
			$(this).siblings('li').children().removeClass('selected');
			$(this).children('a').addClass('selected');
		}

		//点击列表项对内容进行切换
		/*$('.header .bottom')
				.css('background-image','url("../../static/images/pic_banner.png")')
				.css('height','300px');
		$('.arrow').hide();
		var name = $(this).children().attr('id');
		console.log(name);
		$('.main').hide();
		$.get('../' + name + '/' + name + '.html',function(data){
			$('#content').html(data);
		});*/
	//路由的更改
	// 	$(this).children().attr('href',name);
	});


	/*var qq_chat = true;

	function show_qq() {
		alert(qq_chat);
		if (qq_chat) {
			popwin = window.location.href = 'tencent://message/?uin=477077798&Site=易比木官网&Menu=yes'
		}
	}
	setTimeout("show_qq()", 500);*/

	//	点击弹出填写验证信息框
	$('.association').on('click',function(){
		$('.show_qq').attr('src','//shang.qq.com/wpa/qunwpa?idkey=3316cbcec6e085f471b98a1b7c791950719226108100a8997a74606fb754d9b2');
	});

	//页面内点击链接跳转
	/*$('li.f-l ul li').on('click',function(){
		var name = $(this).data('name');
		console.log(name);
		$("#" + name).trigger('click');
		return;
	});*/

});
